package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.ProductInfo;
import com.example.demo.service.ProductInfoService;
import com.example.demo.mapper.ProductInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 18364
* @description 针对表【product_info】的数据库操作Service实现
* @createDate 2024-10-14 15:17:32
*/
@Service
public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, ProductInfo>
    implements ProductInfoService{
    @Autowired
    ProductInfoMapper productInfoMapper;

    @Override
    public ProductInfo selectByAppId(String appId,Integer productType) {
        QueryWrapper<ProductInfo> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("appId",appId);
        queryWrapper.eq("productType",productType);
        queryWrapper.orderByDesc("id");
        return productInfoMapper.selectOne(queryWrapper);
    }
}




